Different Methods of Classical Mechanics

We're seeing the differences in the Newtonian, Hamiltonian, and Lagrangian mechanics.

Keywords: classical mechanics, lagrangian, physics

By Carmen Cincotti  

Introduction

This week, I continued my studies on classical mechanics and how one can derive equations of motion. I ended up finding a pretty easy problem described below (this is an example found in No-Nonsense Classical Mechanics):

I’m on the Tower of Pisa and I drop a ball straight down. I would like to calculate the equation of motion describing the free fall of the ball towards the ground:

Drawing depicting the proposed physics problem

To find this, we can use three different methods. These methods are:

  • Newton’s method
  • The Lagrange method
  • Hamilton’s method

Newton’s method

We start with Newton’s second law:

F=ma=dpdtp=mv\vec{F} = m\vec{a} = \dfrac{d\vec{p}}{dt} \\ \vec{p} = m\vec{v} \\

where F is the force (in 3D), a is the acceleration, p is the momentum, parameterized by t.

Knowing this law, we can rewrite the equation like so:

F=d(mv)dt=m(vxvyvz)ddt\vec{F} = \dfrac{d(m\vec{v})}{dt} = m\begin{pmatrix} v_{x} \\ v_{y} \\ v_{z} \end{pmatrix} \dfrac{d}{dt} \\

Neglecting wind resistance, and assuming the point where we drop the ball is the origin, we can see that the only driving force is gravity:

F=(00mg)\vec{F} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix} \\

which is equivalent to:

d(mv)dt=(00mg)\therefore \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

We can now solve the equation of motion:

0t(00g)dt=0tddt(vxvyvz)dtabdfdtdt=f(b)f(a)(00gt)=(vx(t)vy(t)vz(t))(vx(0)vy(0)vz(0))0t(00gt)dt=0t((vx(t)vy(t)vz(t))(vx(0)vy(0)vz(0)))dt(0012gt2)=(xx(t)xy(t)xz(t))(xx(0)xy(0)xz(0))(vx(0)(t)vy(0)(t)vz(0)(t))+(vx(0)(0)vy(0)(0)vz(0)(0))Initial conditions: v(0)=(000),x(0)=(000)(0012gt2)=(xx(t)xy(t)xz(t))\int_0^t \begin{pmatrix} 0 \\ 0 \\ -g \end{pmatrix} dt = \int_0^t \dfrac{d}{dt} \begin{pmatrix} v_{x} \\ v_{y} \\ v_{z} \end{pmatrix} dt\newline \because \int_a^b \dfrac{df}{dt}dt = f(b) - f(a) \newline \begin{pmatrix} 0 \\ 0 \\ -gt \end{pmatrix} = \begin{pmatrix} v_{x}(t) \\ v_{y}(t) \\ v_{z}(t) \end{pmatrix} - \begin{pmatrix} v_{x}(0) \\ v_{y}(0) \\ v_{z}(0) \end{pmatrix} \newline \int_0^t \begin{pmatrix} 0 \\ 0 \\ -gt \end{pmatrix}dt = \int_0^t (\begin{pmatrix} v_{x}(t) \\ v_{y}(t) \\ v_{z}(t) \end{pmatrix} - \begin{pmatrix} v_{x}(0) \\ v_{y}(0) \\ v_{z}(0) \end{pmatrix}) dt \newline \begin{pmatrix} 0 \\ 0 \\ -\dfrac{1}{2}gt^2 \end{pmatrix} = \begin{pmatrix} x_{x}(t) \\ x_{y}(t) \\ x_{z}(t) \end{pmatrix} - \begin{pmatrix} x_{x}(0) \\ x_{y}(0) \\ x_{z}(0) \end{pmatrix} - \begin{pmatrix} v_{x}(0)(t) \\ v_{y}(0)(t) \\ v_{z}(0)(t) \end{pmatrix} + \begin{pmatrix} v_{x}(0)(0) \\ v_{y}(0)(0) \\ v_{z}(0)(0) \end{pmatrix} \newline \because Initial\ conditions:\ v(0) = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}, x(0) = \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix} \\ \therefore \begin{pmatrix} 0 \\ 0 \\ -\dfrac{1}{2}gt^2 \end{pmatrix} = \begin{pmatrix} x_{x}(t) \\ x_{y}(t) \\ x_{z}(t) \end{pmatrix}

Well, after seeing that it is possible to solve this problem with Newton’s method, let’s move on to Lagrange’s method.

Lagrange’s method

In general, in Lagrangian mechanics, the Lagrangian is::

L(q,q˙)=T(q˙)V(q)L(q, \dot{q}) = T(\dot{q}) - V(q) \\

where T is the kinetic energy, and V is the potential energy.

T=12mv2 and V=mgzL=12m(vx2+vy2+vz2)mgh T = \frac{1}{2}m\vec{v}^2\ and\ V = mgz \\ \therefore L = \frac{1}{2}m(v_x^2 + v_y^2 + v_z^2) - mgh \\

Recall that the Euler-Lagrange equation is as follows:

Lq=ddt(Lvq) \frac{\partial{L}}{\partial{q}} = \frac{d}{dt}(\frac{\partial{L}}{\partial{v_q}}) \\

So we just need to rewrite the Euler-Lagrange equation using our variables:

(12m(vx2+vy2+vz2))mgzx=ddt(12m(vx2+vy2+vz2))mgzvx \frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{x}} = \frac{d}{dt}\frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{v_x}} \\

After having solved the partial derivatives, we end here because we already derived the equation of motion above (under Newton’s method):

d(mv)dt=(00mg) \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

Hamilton’s method

To use the Hamiltonian method, we must first calculate the generalized momenta using the Lagrangian:

L=12m(vx2+vy2+vz2)mgzpq=Lvqpq=(12m(vx2+vy2+vz2))mgzvqpx=mvxpy=mvypz=mvzvx=pxmvy=pymvz=pzm L = \frac{1}{2}m(v_x^2 + v_y^2 + v_z^2) - mgz \\ \because p_q = \frac{\partial{L}}{\partial{v_q}} \\ p_q = \frac{\partial{(\frac{1}{2}m(v_x^2 + v_y^2 + v_z^2))} - mgz}{\partial{v_q}} \\ p_x = mv_x \\ p_y = mv_y \\ p_z = mv_z \\ \therefore v_x = \frac{p_x}{m} \\ \therefore v_y = \frac{p_y}{m} \\ \therefore v_z = \frac{p_z}{m} \\

The Hamiltonian is described as:

H=pq˙L H = \vec{p} \cdot \dot{\vec{q}} - L \\

Which means:

H=(pxpxm+pypym+pzpzm)(12m((pxm)2+(pym)2+(pzm)2)mgz)H=12(px2m+py2m+pz2m)+mgz H = (p_x\frac{p_x}{m} + p_y\frac{p_y}{m} + p_z\frac{p_z}{m}) - (\frac{1}{2}m((\frac{p_x}{m})^2 + (\frac{p_y}{m})^2 + (\frac{p_z}{m})^2) - mgz) \\ \therefore H = \frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz \\

The Hamilton equations are:

dpqdt=Hqdqdt=Hpq \frac{dp_q}{dt} = -\frac{\partial{H}}{\partial{q}} \\ \frac{dq}{dt} = \frac{\partial{H}}{\partial{p_q}} \\

Therefore:

dpqdt=Hq=(12(px2m+py2m+pz2m)+mgz)q \frac{dp_q}{dt} = -\frac{\partial{H}}{\partial{q}} = -\frac{\partial{(\frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz)}}{\partial{q}} \\
(dpxdtdpydtdpzdt)=(00mg)dqdt=Hpq=(12(px2m+py2m+pz2m)+mgz)pq(dxdtdydtdzdt)=(pxmpympzm) \begin{pmatrix} \frac{dp_x}{dt} \\ \frac{dp_y}{dt} \\ \frac{dp_z}{dt} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix} \\ \frac{dq}{dt} = \frac{\partial{H}}{\partial{p_q}} = \frac{\partial{(\frac{1}{2}(\frac{p_x^2}{m} + \frac{p_y^2}{m} + \frac{p_z^2}{m}) + mgz)}}{\partial{p_q}} \\ \begin{pmatrix} \frac{dx}{dt} \\ \frac{dy}{dt} \\ \frac{dz}{dt} \end{pmatrix} = \begin{pmatrix} \frac{p_x}{m} \\ \frac{p_y}{m} \\ \frac{p_z}{m} \end{pmatrix} \\

Finally:

(d(mdxdt)dtd(mdydt)dtd(mdzdt)dt)=d(mv)dt=(00mg) \therefore \begin{pmatrix} \frac{d(m\frac{dx}{dt})}{dt} \\ \frac{d(m\frac{dy}{dt})}{dt} \\ \frac{d(m\frac{dz}{dt})}{dt} \end{pmatrix} = \frac{d(m\vec{v})}{dt} = \begin{pmatrix} 0 \\ 0 \\ -mg \end{pmatrix}

To conclude, the three methods are able to find the equation of motion. But, as you can probably tell, each method has its pros and cons. For example, the Newtonian method requires knowledge of each force acting on the ball. On the other hand, the Hamiltonian is really too wordy and annoying to solve.

The next steps are to understand how to simulate constraints using the Lagrange multiplier.

Resources


Comments for Different Methods of Classical Mechanics



Written by Carmen Cincotti, computer graphics enthusiast, language learner, and improv actor currently living in San Francisco, CA.  Follow @CarmenCincotti

Contribute

Interested in contributing to Carmen's Graphics Blog? Click here for details!